﻿@model IEnumerable<StockShark.ViewModels.ScoreboardData>

@{
    ViewBag.Title = "Ranking";
    ViewBag.Header = "Ranking kont maklerskich";
}

<table id="scoreboard">
<tr>
    <th>Pozycja</th>
    <th>Nazwa rachunku</th>
    <th>Gracz</th>
    <th>Wartość portfela</th>
    <th>Data założenia</th>
</tr>
    
@foreach (var item in Model)
{
<tr>
    <td>@Html.DisplayFor(modelItem => @item.Position)</td>
    <td>@Html.DisplayFor(modelItem => @item.BrokerageAccount.Name)</td>
    <td>@Html.DisplayFor(modelItem => @item.UserName)</td>
    <td>@Html.DisplayFor(modelItem => @item.BrokerageAccount.TotalValue) PLN</td>
    <td>@Html.DisplayFor(modelItem => item.BrokerageAccount.CreationDate)</td>
</tr>
}
<tr>
    <td colspan="5">
    @Html.ActionLink("<<<", "Scoreboard", new { page = 1 }) 
    @Html.ActionLink("<", "Scoreboard", new { page = ViewBag.PageNo - 1 })
    <strong>strona @ViewBag.PageNo z @ViewBag.PagesTotal</strong>
    (pozycje @((ViewBag.PageNo-1)*ViewBag.RecordsPerPage+1) - @(ViewBag.PageNo*ViewBag.RecordsPerPage))
    @Html.ActionLink(">", "Scoreboard", new { page = ViewBag.PageNo + 1 }) 
    @Html.ActionLink(">>>", "Scoreboard", new { page = ViewBag.PagesTotal }) 
    </td>
</tr>        
</table>

